﻿ 
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net;
using System.Threading.Tasks;

namespace LightingPlatform.Communication
{
    public static partial class Services
    {
		public static async Task<LightingPlatform.Communication.ServiceReference1.CommitResponse> CommitAsync(LightingPlatform.Communication.ServiceReference1.CommitRequest request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.CommitRequest, LightingPlatform.Communication.ServiceReference1.CommitResponse>(LightingServiceInterface.BeginCommit, LightingServiceInterface.EndCommit, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.DownloadResourceResponse> DownloadResourceAsync(LightingPlatform.Communication.ServiceReference1.DownloadResourceRequest request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.DownloadResourceRequest, LightingPlatform.Communication.ServiceReference1.DownloadResourceResponse>(LightingServiceInterface.BeginDownloadResource, LightingServiceInterface.EndDownloadResource, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.LoginResponse> LoginAsync(LightingPlatform.Communication.ServiceReference1.LoginRequest request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.LoginRequest, LightingPlatform.Communication.ServiceReference1.LoginResponse>(LightingServiceInterface.BeginLogin, LightingServiceInterface.EndLogin, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.LoadAllLablesResponse> LoadAllLablesAsync(LightingPlatform.Communication.ServiceReference1.LoadAllLablesRequest request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.LoadAllLablesRequest, LightingPlatform.Communication.ServiceReference1.LoadAllLablesResponse>(LightingServiceInterface.BeginLoadAllLables, LightingServiceInterface.EndLoadAllLables, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.QueryLevel2Response> QueryLevel2Async(LightingPlatform.Communication.ServiceReference1.QueryLevel2Request request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.QueryLevel2Request, LightingPlatform.Communication.ServiceReference1.QueryLevel2Response>(LightingServiceInterface.BeginQueryLevel2, LightingServiceInterface.EndQueryLevel2, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.QueryLevel3Response> QueryLevel3Async(LightingPlatform.Communication.ServiceReference1.QueryLevel3Request request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.QueryLevel3Request, LightingPlatform.Communication.ServiceReference1.QueryLevel3Response>(LightingServiceInterface.BeginQueryLevel3, LightingServiceInterface.EndQueryLevel3, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.QueryLevel4Response> QueryLevel4Async(LightingPlatform.Communication.ServiceReference1.QueryLevel4Request request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.QueryLevel4Request, LightingPlatform.Communication.ServiceReference1.QueryLevel4Response>(LightingServiceInterface.BeginQueryLevel4, LightingServiceInterface.EndQueryLevel4, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.QueryLevel5Response> QueryLevel5Async(LightingPlatform.Communication.ServiceReference1.QueryLevel5Request request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.QueryLevel5Request, LightingPlatform.Communication.ServiceReference1.QueryLevel5Response>(LightingServiceInterface.BeginQueryLevel5, LightingServiceInterface.EndQueryLevel5, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.QueryResponse> QueryAsync(LightingPlatform.Communication.ServiceReference1.QueryRequest request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.QueryRequest, LightingPlatform.Communication.ServiceReference1.QueryResponse>(LightingServiceInterface.BeginQuery, LightingServiceInterface.EndQuery, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.GetUsersResponse> GetUsersAsync(LightingPlatform.Communication.ServiceReference1.GetUsersRequest request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.GetUsersRequest, LightingPlatform.Communication.ServiceReference1.GetUsersResponse>(LightingServiceInterface.BeginGetUsers, LightingServiceInterface.EndGetUsers, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.AddUserResponse> AddUserAsync(LightingPlatform.Communication.ServiceReference1.AddUserRequest request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.AddUserRequest, LightingPlatform.Communication.ServiceReference1.AddUserResponse>(LightingServiceInterface.BeginAddUser, LightingServiceInterface.EndAddUser, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.DeleteUserResponse> DeleteUserAsync(LightingPlatform.Communication.ServiceReference1.DeleteUserRequest request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.DeleteUserRequest, LightingPlatform.Communication.ServiceReference1.DeleteUserResponse>(LightingServiceInterface.BeginDeleteUser, LightingServiceInterface.EndDeleteUser, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

		public static async Task<LightingPlatform.Communication.ServiceReference1.UpdateUserResponse> UpdateUserAsync(LightingPlatform.Communication.ServiceReference1.UpdateUserRequest request)
        {
			try
			{
				return await Task.Factory.FromAsync<LightingPlatform.Communication.ServiceReference1.UpdateUserRequest, LightingPlatform.Communication.ServiceReference1.UpdateUserResponse>(LightingServiceInterface.BeginUpdateUser, LightingServiceInterface.EndUpdateUser, request, null);
            }
            catch (Exception e)
            {
                throw e;
            }
		}

	
    }
}
